import request from '@/utils/request'

// 查询订单地址列表
export function listAddress(query) {
  return request({
    url: '/system/orderAddress/list',
    method: 'get',
    params: query
  })
}

// 查询订单地址详细
export function getAddress(ordersAddressId) {
  return request({
    url: '/system/orderAddress/' + ordersAddressId,
    method: 'get'
  })
}
export function getOrderAddressDetil(orderId) {
  return request({
    url: '/system/orderAddress/addressDetil/' + orderId,
    method: 'get'
  })
}

// 新增订单地址
export function addAddress(data) {
  return request({
    url: '/system/orderAddress',
    method: 'post',
    data: data
  })
}

// 修改订单地址
export function updateAddress(data) {
  return request({
    url: '/system/orderAddress',
    method: 'put',
    data: data
  })
}

// 删除订单地址
export function delAddress(ordersAddressId) {
  return request({
    url: '/system/orderAddress/' + ordersAddressId,
    method: 'delete'
  })
}

// 导出订单地址
export function exportAddress(query) {
  return request({
    url: '/system/orderAddress/export',
    method: 'get',
    params: query
  })
}
